<div :class="{ 'grid': true, 'show-paging-bar': isEnablePagingBar, 'hidden-paging-bar': !isEnablePagingBar }">
    <i-form>
        <el-table v-if="isDisplay === true"
            :default-sort="{ prop: minorSortPSDEF, order: Object.is(minorSortDir, 'ASC') ? 'ascending' : Object.is(minorSortDir, 'DESC') ? 'descending' : '' }"  
            @sort-change="onSortChange($event)"  
            :border="isDragendCol"
            :highlight-current-row ="isSingleSelect"
            :row-class-name="getRowClassName.bind(_self)"
            :cell-class-name="getCellClassName.bind(_self)"
            size="mini"
            stripe
            :height="tableHeight"
            @row-click="rowClick($event)"  
            @select-all="selectAll($event)"  
            @select="select.apply(_self, arguments)"  
            @row-class-name="onRowClassName($event)"  
            @row-dblclick="rowDBLClick($event)"  
            ref="multipleTable" :data="items" :show-header="!isHideHeader"
        >
            <template slot="empty">
                {{$t('entities.pfemp.main2_grid.nodata')}} 
                <span class="quick-toolbar">
                </span>
            </template>
            <template v-if="!isSingleSelect">
                <el-table-column align="center" type="selection" :width="checkboxColWidth"></el-table-column>
            </template>
            <template v-if="getColumnState('empcode')">
                <el-table-column show-overflow-tooltip :prop="'empcode'" :label="$t('entities.pfemp.main2_grid.columns.empcode')" :width="100"  :align="'left'" :sortable="'custom'">
                    <template v-slot:header="{column}">
                       <span class="column-header ">
                        {{$t('entities.pfemp.main2_grid.columns.empcode')}}
                       </span>
                    </template>
                    <template v-slot="{row,column,$index}">
                            <span>{{row.empcode}}</span>
                    </template>
                </el-table-column>
            </template>
            <template v-if="getColumnState('pfempname')">
                <el-table-column show-overflow-tooltip :prop="'pfempname'" :label="$t('entities.pfemp.main2_grid.columns.pfempname')" :width="150"  :align="'left'" :sortable="'custom'">
                    <template v-slot:header="{column}">
                       <span class="column-header ">
                        {{$t('entities.pfemp.main2_grid.columns.pfempname')}}
                       </span>
                    </template>
                    <template v-slot="{row,column,$index}">
                        <app-column-link
                            deKeyField="pfemp"
                            :context="JSON.parse(JSON.stringify(context))"
                            :viewparams="JSON.parse(JSON.stringify(viewparams))"
                            :data="row"
                            :linkview="{viewname: 'pfempedit-view', height: 0,width: 0,title: $t('entities.pfemp.views.editview.title'),placement: 'DRAWER_TOP', isRedirectView: false,deResParameters: [
            ]
            ,parameters: [
            { pathName: 'pfemps', parameterName: 'pfemp' },
            { pathName: 'editview', parameterName: 'editview' }
            ]}"
                            valueitem="srfkey"
                        >
                            <span>{{row.pfempname}}</span>
                        </app-column-link>
                    </template>
                </el-table-column>
            </template>
            <template v-if="getColumnState('majorteamname')">
                <el-table-column show-overflow-tooltip :prop="'majorteamname'" :label="$t('entities.pfemp.main2_grid.columns.majorteamname')" :width="120"  :align="'left'" :sortable="'custom'">
                    <template v-slot:header="{column}">
                       <span class="column-header ">
                        {{$t('entities.pfemp.main2_grid.columns.majorteamname')}}
                       </span>
                    </template>
                    <template v-slot="{row,column,$index}">
                        <app-column-link
                            deKeyField="pfteam"
                            :context="JSON.parse(JSON.stringify(context))"
                            :viewparams="JSON.parse(JSON.stringify(viewparams))"
                            :data="row"
                            :linkview="{viewname: 'pfteamedit-view', height: 0,width: 0,title: $t('entities.pfteam.views.editview.title'),placement: 'DRAWER_TOP', isRedirectView: false,deResParameters: [
            ]
            ,parameters: [
            { pathName: 'pfteams', parameterName: 'pfteam' },
            { pathName: 'editview', parameterName: 'editview' }
            ]}"
                            valueitem="majorteamid"
                        >
                            <span>{{row.majorteamname}}</span>
                        </app-column-link>
                    </template>
                </el-table-column>
            </template>
            <template v-if="getColumnState('certcode')">
                <el-table-column show-overflow-tooltip :prop="'certcode'" :label="$t('entities.pfemp.main2_grid.columns.certcode')" :width="150"  :align="'left'" :sortable="'custom'">
                    <template v-slot:header="{column}">
                       <span class="column-header ">
                        {{$t('entities.pfemp.main2_grid.columns.certcode')}}
                       </span>
                    </template>
                    <template v-slot="{row,column,$index}">
                            <span>{{row.certcode}}</span>
                    </template>
                </el-table-column>
            </template>
            <template v-if="getColumnState('empsex')">
                <el-table-column show-overflow-tooltip :prop="'empsex'" :label="$t('entities.pfemp.main2_grid.columns.empsex')" :width="100"  :align="'left'" :sortable="'custom'">
                    <template v-slot:header="{column}">
                       <span class="column-header ">
                        {{$t('entities.pfemp.main2_grid.columns.empsex')}}
                       </span>
                    </template>
                    <template v-slot="{row,column,$index}">
                        <template >
            <codelist :value="row.empsex" tag="EMEMPSEX" codelistType="STATIC" ></codelist>
                        </template>
                    </template>
                </el-table-column>
            </template>
            <template v-if="getColumnState('birthday')">
                <el-table-column show-overflow-tooltip :prop="'birthday'" :label="$t('entities.pfemp.main2_grid.columns.birthday')" :width="100"  :align="'left'" :sortable="'custom'">
                    <template v-slot:header="{column}">
                       <span class="column-header ">
                        {{$t('entities.pfemp.main2_grid.columns.birthday')}}
                       </span>
                    </template>
                    <template v-slot="{row,column,$index}">
                            <app-format-data format="YYYY-MM-DD" :data="row.birthday"></app-format-data>
                    </template>
                </el-table-column>
            </template>
            <template v-if="getColumnState('tel')">
                <el-table-column show-overflow-tooltip :prop="'tel'" :label="$t('entities.pfemp.main2_grid.columns.tel')" :width="100"  :align="'left'" :sortable="'custom'">
                    <template v-slot:header="{column}">
                       <span class="column-header ">
                        {{$t('entities.pfemp.main2_grid.columns.tel')}}
                       </span>
                    </template>
                    <template v-slot="{row,column,$index}">
                            <span>{{row.tel}}</span>
                    </template>
                </el-table-column>
            </template>
            <template v-if="getColumnState('cell')">
                <el-table-column show-overflow-tooltip :prop="'cell'" :label="$t('entities.pfemp.main2_grid.columns.cell')" :width="100"  :align="'left'" :sortable="'custom'">
                    <template v-slot:header="{column}">
                       <span class="column-header ">
                        {{$t('entities.pfemp.main2_grid.columns.cell')}}
                       </span>
                    </template>
                    <template v-slot="{row,column,$index}">
                            <span>{{row.cell}}</span>
                    </template>
                </el-table-column>
            </template>
            <template v-if="getColumnState('addr')">
                <el-table-column show-overflow-tooltip :prop="'addr'" :label="$t('entities.pfemp.main2_grid.columns.addr')" :width="100"  :align="'left'" :sortable="'custom'">
                    <template v-slot:header="{column}">
                       <span class="column-header ">
                        {{$t('entities.pfemp.main2_grid.columns.addr')}}
                       </span>
                    </template>
                    <template v-slot="{row,column,$index}">
                            <span>{{row.addr}}</span>
                    </template>
                </el-table-column>
            </template>
            <template v-if="getColumnState('e_mail')">
                <el-table-column show-overflow-tooltip :prop="'e_mail'" :label="$t('entities.pfemp.main2_grid.columns.e_mail')" :width="100"  :align="'left'" :sortable="'custom'">
                    <template v-slot:header="{column}">
                       <span class="column-header ">
                        {{$t('entities.pfemp.main2_grid.columns.e_mail')}}
                       </span>
                    </template>
                    <template v-slot="{row,column,$index}">
                            <span>{{row.e_mail}}</span>
                    </template>
                </el-table-column>
            </template>
            <template v-if="getColumnState('orgid')">
                <el-table-column show-overflow-tooltip :prop="'orgid'" :label="$t('entities.pfemp.main2_grid.columns.orgid')" :width="100"  :align="'left'" :sortable="'custom'">
                    <template v-slot:header="{column}">
                       <span class="column-header ">
                        {{$t('entities.pfemp.main2_grid.columns.orgid')}}
                       </span>
                    </template>
                    <template v-slot="{row,column,$index}">
                        <template >
            <codelist :value="row.orgid" tag="PFCL_ORG" codelistType="STATIC" ></codelist>
                        </template>
                    </template>
                </el-table-column>
            </template>
            <template v-if="getColumnState('workdate')">
                <el-table-column show-overflow-tooltip :prop="'workdate'" :label="$t('entities.pfemp.main2_grid.columns.workdate')" :width="100"  :align="'left'" :sortable="'custom'">
                    <template v-slot:header="{column}">
                       <span class="column-header ">
                        {{$t('entities.pfemp.main2_grid.columns.workdate')}}
                       </span>
                    </template>
                    <template v-slot="{row,column,$index}">
                            <app-format-data format="YYYY-MM-DD" :data="row.workdate"></app-format-data>
                    </template>
                </el-table-column>
            </template>
            <template v-if="getColumnState('raisedate')">
                <el-table-column show-overflow-tooltip :prop="'raisedate'" :label="$t('entities.pfemp.main2_grid.columns.raisedate')" :width="140"  :align="'left'" :sortable="'custom'">
                    <template v-slot:header="{column}">
                       <span class="column-header ">
                        {{$t('entities.pfemp.main2_grid.columns.raisedate')}}
                       </span>
                    </template>
                    <template v-slot="{row,column,$index}">
                            <app-format-data format="YYYY-MM-DD" :data="row.raisedate"></app-format-data>
                    </template>
                </el-table-column>
            </template>
            <template v-if="getColumnState('hometel')">
                <el-table-column show-overflow-tooltip :prop="'hometel'" :label="$t('entities.pfemp.main2_grid.columns.hometel')" :width="100"  :align="'left'" :sortable="'custom'">
                    <template v-slot:header="{column}">
                       <span class="column-header ">
                        {{$t('entities.pfemp.main2_grid.columns.hometel')}}
                       </span>
                    </template>
                    <template v-slot="{row,column,$index}">
                            <span>{{row.hometel}}</span>
                    </template>
                </el-table-column>
            </template>
            <template v-if="getColumnState('homeaddr')">
                <el-table-column show-overflow-tooltip :prop="'homeaddr'" :label="$t('entities.pfemp.main2_grid.columns.homeaddr')" :width="100"  :align="'left'" :sortable="'custom'">
                    <template v-slot:header="{column}">
                       <span class="column-header ">
                        {{$t('entities.pfemp.main2_grid.columns.homeaddr')}}
                       </span>
                    </template>
                    <template v-slot="{row,column,$index}">
                            <span>{{row.homeaddr}}</span>
                    </template>
                </el-table-column>
            </template>
            <template v-if="getColumnState('description')">
                <el-table-column show-overflow-tooltip :prop="'description'" :label="$t('entities.pfemp.main2_grid.columns.description')" :width="100"  :align="'left'" :sortable="'custom'">
                    <template v-slot:header="{column}">
                       <span class="column-header ">
                        {{$t('entities.pfemp.main2_grid.columns.description')}}
                       </span>
                    </template>
                    <template v-slot="{row,column,$index}">
                            <span>{{row.description}}</span>
                    </template>
                </el-table-column>
            </template>
            <template v-if="adaptiveState">
                <el-table-column></el-table-column>
            </template>
        </el-table>
        <row class="grid-pagination" v-show="items.length > 0">
            <page class="pull-right" @on-change="pageOnChange($event)" 
                @on-page-size-change="onPageSizeChange($event)"
                :total="totalRecord"
                show-sizer :current="curPage" :page-size="limit"
                :page-size-opts="[10, 20, 30, 40, 50, 60, 70, 80, 90, 100]" show-elevator show-total>
                <span>
                    <span class="page-column">
                        <poptip transfer-class-name="grid-column" transfer placement="top-start">
                            <i-button icon="md-menu">{{$t('app.gridpage.choicecolumns')}}</i-button>
                            <div slot="content">
                                <template v-for="col in allColumns">
                                    <div :key="col.name"><el-checkbox v-model="col.show" @change="onColChange()">{{$t(col.langtag)}}</el-checkbox></div>
                                </template>
                            </div>
                        </poptip>
                    </span>
                    <span class="page-button"><i-button icon="md-refresh" :title="$t('app.gridpage.refresh')" @click="pageRefresh()"></i-button></span>&nbsp;
                    <span>
                        {{$t('app.gridpage.show')}}&nbsp;
                        <span>
                            <template v-if="items.length === 1">
                            1
                            </template>
                            <template v-else>
                                <span>{{(curPage - 1) * limit + 1}}&nbsp;-&nbsp;{{totalRecord > curPage * limit ? curPage * limit : totalRecord}}</span>
                            </template>
                        </span>&nbsp;
                        {{$t('app.gridpage.records')}}，{{$t('app.gridpage.totle')}}&nbsp;{{totalRecord}}&nbsp;{{$t('app.gridpage.records')}}
                    </span>
                </span>
            </page>
        </row>
    </i-form>
</div>